/**
 * 课程分类 api 封装
 *
 * @Author:    AKITA
 * @Date:      2025-05-22 15:22:00
 * @Copyright  AKITA
 */
import { postRequest, getRequest } from '/@/lib/axios';

export const courseApi = {
  /**
   * 分页查询  @author  AKITA
   */
  queryPage: (param) => {
    return postRequest('/course/queryPage', param);
  },

  /**
   * 增加  @author  AKITA
   */
  add: (param) => {
    return postRequest('/course/add', param);
  },

  /**
   * 修改  @author  AKITA
   */
  update: (param) => {
    return postRequest('/course/update', param);
  },

  /**
   * 删除  @author  AKITA
   */
  delete: (id) => {
    return getRequest(`/course/delete/${id}`);
  },

  /**
   * 批量删除  @author  AKITA
   */
  batchDelete: (idList) => {
    return postRequest('/course/batchDelete', idList);
  },

  info: (param) => {
    return getRequest('/course/info/' + param);
  },

  openAll: (param) => {
    return getRequest('/course/openAll/' + param);
  },
};

export const courseaApi = {
  /**
   * 分页查询  @author  AKITA
   */
  queryPage: (param) => {
    return postRequest('/coursea/queryPage', param);
  },

  /**
   * 增加  @author  AKITA
   */
  add: (param) => {
    return postRequest('/coursea/add', param);
  },

  /**
   * 修改  @author  AKITA
   */
  update: (param) => {
    return postRequest('/coursea/update', param);
  },

  /**
   * 删除  @author  AKITA
   */
  delete: (id) => {
    return getRequest(`/coursea/delete/${id}`);
  },

  /**
   * 批量删除  @author  AKITA
   */
  batchDelete: (idList) => {
    return postRequest('/coursea/batchDelete', idList);
  },
};

export const coursebApi = {
  /**
   * 分页查询  @author  AKITA
   */
  queryPage: (param) => {
    return postRequest('/courseb/queryPage', param);
  },

  /**
   * 增加  @author  AKITA
   */
  add: (param) => {
    return postRequest('/courseb/add', param);
  },

  /**
   * 修改  @author  AKITA
   */
  update: (param) => {
    return postRequest('/courseb/update', param);
  },

  /**
   * 删除  @author  AKITA
   */
  delete: (id) => {
    return getRequest(`/courseb/delete/${id}`);
  },

  /**
   * 批量删除  @author  AKITA
   */
  batchDelete: (idList) => {
    return postRequest('/courseb/batchDelete', idList);
  },

    batchAdd: (id, form) => {
        return postRequest(`/courseb/batchadd/${id}`, form);
    },
};
